/**
 * Created by Administrator on 2017/4/25.
 */
    //月订单折线图
var myChart =echarts.init(document.getElementById('chart1'));
option = {
    tooltip: {
        trigger: 'axis',
        axisPointer: {type: 'cross'}
    },
    color:["#F6CA4B","#EC47A3"],
    toolbox: {
        feature: {
            dataView: {show: false, readOnly: false},
            magicType: {show: false, type: ['line', 'bar']},
            restore: {show: false},
            saveAsImage: {show:false}
        }
    },
    legend: {
        data:['订单金额','订单数量']
    },
    xAxis: [
        {
            type: 'category',
            data: ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30']
        }
    ],
    yAxis: [
        {
            type: 'value',
            name: '订单金额',
            min: 0,
            max: 100000,
            interval: 20000,
            axisLabel: {
                formatter: '￥{value}'
            }
        },
        {
            type: 'value',
            name: '订单数量',
            min: 0,
            max: 10,
            interval: 2,
            axisLabel: {
                formatter: '{value}个'
            }
        }
    ],
    series: [
        {
            name:'订单金额',
            type:'bar',
            barWidth:'15px',
            data:[11598,23155,54512,15646,45623,71511,52516,92315,43214,68548,78962,62214,38995,35885,17795,15886,85110,78952,49984,78954,98545,58894,36852,96964,74158,25741,56958,48965,47825,85235]
        },
        {
            name:'订单数量',
            type:'line',
            yAxisIndex: 1,
            data:[2,5,9,9,7,1,5,6,8,2,3,6,1,4,7,1,5,4,7,8,5,4,9,6,3,10,2,5,8,7]
        }
    ]
};
myChart.setOption(option);
//已付款折线图
var myChart2 = echarts.init(document.getElementById('chart2'));
option = {
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'cross'
        }
    },
    color:["#679BFE","#EC47A3"],
    toolbox: {
        feature: {
            dataView: {show: false, readOnly: false},
            magicType: {show: false, type: ['line', 'bar']},
            restore: {show: false},
            saveAsImage: {show:false}
        }
    },
    legend: {
        data:['待收款','已付款']
    },
    grid:{
      	left:'20%',//组件距离容器左边的距离
      },
    xAxis: [
        {
            type: 'category',
            data: ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30']
        }
    ],
    yAxis: [
        {
            type: 'value',
            name: '金额',
            min: 0,
            max: 120000,
            interval: 20000,
            axisLabel: {
                formatter: '￥{value}'
            }
        },

    ],
    series: [
        {
            name:'已付款',
            type:'bar',
            barWidth:'5px',
            data:[11598,23155,54512,15646,45623,71511,52516,92315,43214,68548,78962,62214,38995,35885,17795,15886,85110,78952,49984,78954,98545,58894,36852,96964,74158,25741,56958,48965,47825,85235]
        },
        {
            name:'待收款',
            type:'line',
            data:[11598,23155,64512,15646,85623,25122,52516,32315,43214,68548,52365,62214,38995,25885,17795,15886,35110,8952,19984,58954,98545,58894,36852,36964,24158,25741,26958,41965,47825,85235]
        }
    ]
};

myChart2.setOption(option);
window.onresize = function(){
	myChart.resize(); //myEchart为echarts.init初始化得到的对象
	myChart2.resize(); //myEchart为echarts.init初始化得到的对象
}